package org.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.example.pojo.UmsUserRole;
import org.example.mapper.UmsUserRoleMapper;
import org.example.service.IUmsUserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户角色 服务实现类
 * </p>
 *
 * @author wy
 * @since 2023-10-04
 */
@Service
public class UmsUserRoleServiceImpl extends ServiceImpl<UmsUserRoleMapper, UmsUserRole> implements IUmsUserRoleService {
    @Override
    public UmsUserRole getByUserId(Integer userId) {
        QueryWrapper<UmsUserRole> wrapper = new QueryWrapper<>();
        wrapper.eq("user_id",userId);
        return this.getOne(wrapper);
    }
}
